#include <GL/glut.h>
#include <math.h>

const int n = 20;
const GLfloat R = 0.5f;
const GLfloat Pi = 3.1415926536f;

void myDisplay(void) {
	glClear(GL_COLOR_BUFFER_BIT);
	glBegin(GL_POLYGON);
		for(int i=0; i<n; i++)
			glVertex2f(R*cos(2*Pi/n*i), R*sin(2*Pi/n*i));
	glEnd();
	glFlush();
}

int main(int argc, char * argv[]) {
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
	glutInitWindowPosition(300, 400);
	glutInitWindowSize(400, 400);
	glutCreateWindow("OpenGL Program 3: Circle");

	glutDisplayFunc(myDisplay);

	glutMainLoop();

	return 0;
}
